package com.cucn.common.constant.ware;

/**
 * @author KouChaoJie
 * @since: 2021/12/6 15:43
 */
public class WareConstant {
    /**
     * 采购单状态枚举
     */
    public enum PurchaseStatusEnum {
        /**
         * 采购单状态-新建
         */
        CREATED(0, "新建"),
        /**
         * 采购单状态-已分配
         */
        ASSIGNED(1, "已分配"),
        /**
         * 采购单状态-已领取
         */
        RECEIVE(2, "已领取"),
        /**
         * 采购单状态-已完成
         */
        FINISH(3, "已完成"),
        /**
         * 采购单状态-采购失败
         */
        HASERR(4, "有异常");

        private int code;
        private String msg;

        PurchaseStatusEnum(int code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        public int getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }
    }

    /**
     * 采购需求状态枚举
     */
    public enum PurchaseDetailStatusEnum {
        /**
         * 采购单状态-新建
         */
        CREATED(0, "新建"),
        /**
         * 采购单状态-已分配
         */
        ASSIGNED(1, "已分配"),
        /**
         * 采购单状态-已领取
         */
        BUYING(2, "正在采购"),
        /**
         * 采购单状态-已完成
         */
        FINISH(3, "已完成"),
        /**
         * 采购单状态-采购失败
         */
        HASERR(4, "采购失败");

        private int code;
        private String msg;

        PurchaseDetailStatusEnum(int code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        public int getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }
    }

    /**
     * 库存锁定成功
     */
    public static final Integer LOCK_STATUS_SUCCESS = 1;
    /**
     * 库存已解锁
     */
    public static final Integer LOCK_STATUS_UNLOCK = 2;
    /**
     * 库存扣减
     */
    public static final Integer LOCK_STATUS_DEDUCTION = 3;
    /**
     * 库存MQ使用的交换机
     */
    public static final String STOCK_EVENT_EXCHANGE = "stock-event-exchange";
    /**
     * stock.release.stock.queue
     * 接收死信队列后传出的消息
     */
    public static final String STOCK_RELEASE_STOCK_QUEUE = "stock.release.stock.queue";
    /**
     * stock.delay.queue
     * 延时队列
     * （死信队列）
     */
    public static final String STOCK_DELAY_QUEUE = "stock.delay.queue";
    /**
     * 延时队列(死信队列)的绑定关系路由键
     */
    public static final String STOCK_LOCKED_BINDING_ROUTINGKEY = "stock.locked";
    /**
     * release队列的绑定关系路由键
     */
    public static final String STOCK_RELEASE_BINDING_ROUTINGKEY = "stock.release.#";
    /**
     * 死信消息路由键
     */
    public static final String X_DEAD_LETTER_ROUTING_KEY = "stock.release";
    /**
     * 消息过期时间
     */
    public static final int X_MESSAGE_TTL = 120000;
}
